Skip to main content

PutObject

Description

PutObject is used to upload files (Object).

Request Method

POST

Request Path

/apsara/route/OneRouter/PutObject

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
x-oss-taggingBODYstringNoxx=1specifies the label of the object. multiple labels can be set at the same time, for example: TagA = A & amp;TagB = B. indicates that Key and Value require advanced URL encoding. if an item does not have "=", Value is regarded as an empty character.
x-oss-object-aclBODYstringNoprivateSpecify the access permission when OSS creates an object. legal values: public-read, private, public-read-write
Cache-ControlBODYstringNono-cachespecifies the caching behavior of the web page when the object is downloaded. For more information, please refer to RFC2616.
x-oss-server-side-data-encryptionBODYstringNoSM4specifies the encryption algorithm of the object. If this option is not specified, Object uses the AES256 encryption algorithm. This option is only available if x-oss-server-side-encryption is valid for KMS. Value: SM4
regionIdBODYstringYesNo sample value for this parameter.region id
Content-DispositionBODYstringNoattachment;filename=oss_download.jpgspecifies the name of the object when it is downloaded. For more information, please refer to RFC2616.
Content-EncodingBODYstringNoutf-8specifies the content encoding format when the object is downloaded. For more information, please refer to RFC2616. type: string default value: none
ExpiresBODYstringNoFri, 28 Feb 2012 05:38:42 GMTexpiration time. For more information, please refer to RFC2616. indicates that OSS will not restrict or verify this value.
x-oss-server-side-encryptionBODYstringNoKMSWhen creating an Object, specify the server-side encryption method. Value: AES256, KMS or SM4 after specifying this parameter, this parameter is returned in the response header. OSS encrypts and stores the uploaded object. When the object is downloaded, the response header will contain the x-oss-server-side-encryption, and the value will be set to the encryption algorithm of the object.
versionBODYstringNo2016-01-01version of api
x-oss-server-side-encryption-key-idBODYstringNo3dea0cae-5fd6-4bf8-8574-87c557******KMS hosted user master key. This parameter is only available in x-oss-server-side-encryption is valid for KMS.
Content-MD5BODYstringNouk8Os/oShU2MMhcajpeAVA==calculates the MD5 value for the message content (excluding the header) according to the protocol RFC 1864 to obtain a 128-bit number, and base64 encodes the number as the Content-MD5 value of a message. The request header can be used to check the legality of the message (whether the message content is consistent with the time of sending). Although the request header is optional, OSS recommends that you use the request header for end-to-end checking.

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}